<script setup lang="ts">
import { ref } from 'vue';

const isShow = ref(false)
const toggle = (value: boolean, intro: string) => {
  isShow.value = !value
  alert(intro)
}
</script>

<template>
  <div class="app-page">
    <div v-show="isShow" class="box"></div>
    <button @click="toggle(isShow, '你好哈')">切换</button>
  </div>
</template>

<style lang="css" scoped>
.box {
  width: 100px;
  height: 100px;
  background-color: pink;
}
</style>
